<?php
	class Dao {
		var $url = "localhost";
		
		var $username = "root";
		
		var $password = "root";
		
		var $db = "hdm0210126_db";
		
		function query($sql, $pageSize = 20, $first = false) {
			//echo  "url:".$this->url;
			$conn = mysql_connect($this->url, $this->username, $this->password);
			$array = array();
			if($conn){  
				mysql_select_db($this->db, $conn);
				//echo "连接成功";
				$resoure = mysql_query($sql, $conn);
				
				while ($row = mysql_fetch_array($resoure )) {
					$array[] = $row;
				}
				mysql_free_result( $resoure );
			} else {
				//echo "连接失败".$conn;
			}
			return $array;
		}
	}
?>